<template>
<div>

    <h2>sub.vue。显示数据，计算属性</h2>
    <h2>state：{{$store.state.count}}</h2>
    <h3>getter：{{$store.getters.getterCount}}</h3>

    <p>以下是映射方法：</p>
    <h2>...mapSatate(count)：{{count}}</h2>
    <h2>...mapSatate(num)：{{num}}</h2>



</div>
</template>

<script>

   import {mapState,mapMutations} from "vuex"

export default {
    data() {
        return {
           msg:123
        };
    },


    computed:{
        newMsg(){
            return "~~~~~~"+this.msg+"~~~~~~~~~~~~~"
        },
        ...mapState(["count",'num'])
    }
        
    


    }
</script>


<style scoped>

    span{
        font-size: 30px;
        padding:0 10px;
        color: red;
    }
   

</style>